package com.itheima.dao;

import com.itheima.pojo.CheckItem;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CheckItemDao {

    @Insert("insert into t_checkitem(code,name,sex,age,price,type,remark,attention) values (#{code},#{name},#{sex},#{age},#{price},#{type},#{remark},#{attention})")
    public void add(CheckItem checkItem);

    List<CheckItem> selectByCondition(String condition);


    @Select("select * from t_checkitem limit #{start},#{end} ")
    List<CheckItem> selectAllByPage(@Param("start") int start,@Param("end") Integer pageSize);

    int selectCount(String queryString);

    @Select("select count(*) from t_checkgroup_checkitem where checkitem_id = #{id}")
    int selectCountById(int id);

    void deleteById(int id);

    void edit(CheckItem checkItem);

    List<CheckItem> findAll();
}
